<?php
include('../paging_userhistry/paginator.class.php');
error_reporting(E_ALL^E_NOTICE);
if($_SERVER['HTTP_HOST']=="www.ramkydelhi.com"||$_SERVER['HTTP_HOST']=="ramkydelhi.com")
{
	$conn = new mysqli('localhost', 'ramky123_ramky', 'ramky123','ramky123_ramky') ;
}
else
{
	$conn = new mysqli('localhost', 'root', 'spPRdDCA2m47dmKa','ramky123_ramky') ;
}
$query="select * from tbl_dtls_user_history";

if(!empty($_GET['search'])){
	$searchQuery = $_GET['search'];
}

$pageId= intval($_GET['page']);
if (empty($pageId)) {
	$pageId = 1;
}else{
	$pageId = intval($pageId); 
}

$recPerPage = 50;
$paginator = new Paginator($pageId,$recPerPage,$query,$conn);

// fields to search in
// string or array of fields
$paginator->fields = 'name';
$paginator->searchQuery = $searchQuery;
$rows = $paginator->paginate();
?>
<div id="listing_container">
<table border="0" width="300px" id="table21" height="60%" cellspacing="1" style=" padding-top:0px" >
<tr bgcolor="FF9966">
	<td height="29" align="left" valign="top" bgcolor="#FF9966">&nbsp;</td>
	<td bgcolor="#FF9966" align="left" valign="top">&nbsp;</td>
	<td bgcolor="#FF9966" align="left" valign="top" colspan="5">&nbsp;</td>
	<td height="29" align="left" valign="top" bgcolor="#FF9966">&nbsp;</td>
	<td bgcolor="#FF9966" align="left" valign="top">&nbsp;</td>
</tr>
<tr>
	<td bgcolor="#E5E5E5" align="left" valign="top" width="1%">&nbsp;</td>
	<td bgcolor="#E5E5E5" align="left" valign="top" width="5%">
	<!--<img border="0" src="images/my_pag2.jpg">--></td>
	<td bgcolor="#E5E5E5" align="left" width="91%" colspan="5">
	<span lang="en-us">&nbsp;</span><span lang="en-us" style="font-size: 8.5pt"><font face="Verdana" color="#006699"><b>USER HISTORY</b></font></span></td>
	<td bgcolor="#E5E5E5" align="left" valign="top" width="1%">&nbsp;</td>
	<td bgcolor="#E5E5E5" align="left" valign="top" width="5%">
</tr>

<tr>
	<td bgcolor="#E5E5E5" align="left" valign="top" colspan="7">
	<span style="font-size: 3pt" lang="en-us">&nbsp;</span></td>
	<td bgcolor="#E5E5E5" align="left" valign="top" colspan="7"></td>
</tr>
<tr>
	<td bgcolor="#E5E5E5" align="left" valign="top">&nbsp;</td>
	<td bgcolor="#E5E5E5" align="left" valign="top">&nbsp;</td>
	<td bgcolor="#E5E5E5" align="left" valign="top" colspan="5" bordercolor="#F2F2F2"></td>
	<td bgcolor="#E5E5E5" align="left" valign="top">&nbsp;</td>
	<td bgcolor="#E5E5E5" align="left" valign="top">&nbsp;</td>
</tr>
<tr>
	<td bgcolor="#E5E5E5" align="left" valign="top">&nbsp;</td>
	<td bgcolor="#E5E5E5" align="left" valign="top">&nbsp;</td>
	<td align="left" valign="top" colspan="5">
	<table border="0" width="750" id="table22" cellspacing="0" cellpadding="0">
								<!--<tr>
									<td bgcolor="#050505" height="1"></td>
								</tr>!-->
								<tr>
									<td>
										<table border="1" cellpadding="2" cellspacing="0" class="" align="center" width="600">
                                        <tr><td><b><font face="Verdana" style="font-size: 8.5pt" color="#000000">User Id</font></b></td><td><b><font face="Verdana" style="font-size: 8.5pt" color="#000000">Form Id</font></b></td><td><b><font face="Verdana" style="font-size: 8.5pt" color="#000000">Action Id</font></b></td><td><b><font face="Verdana" style="font-size: 8.5pt" color="#000000">Ip Address</font></b></td><td><b><font face="Verdana" style="font-size: 8.5pt" color="#000000">Modify Date</font></b></td><td><b><font face="Verdana" style="font-size: 8.5pt" color="#000000">User Type</font></b></td><td><b><font face="Verdana" style="font-size: 8.5pt" color="#000000">User Name</font></b></td></tr>
                                        <?php
                                       foreach($rows as $row)
                                            {
	
                                         ?>
                                        <tr><td><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo $row['user_id'];?></font></td><td><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo $row['form_id'];?></font></td><td><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo $row['action_id'];?></font></td><td><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo $row['ip_address'];?></font></td><td><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo $row['modify_date'];?></font></td><td><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo $row['user_type'];?></font></td><td><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo $row['user_name'];?></font></td></tr>                     
                                        <?php
                                         }
                                        ?>
                                         </table>
                                        
					</td>
										
				</tr>
				
				
				<tr>
					<td><p align="center"></td>
				</tr>
				<tr>
					<td>&nbsp;</td>
				</tr>
</table>					
</td>
<td bgcolor="#E5E5E5" align="left" valign="top">&nbsp;</td>
	<td bgcolor="#E5E5E5" align="left" valign="top">&nbsp;</td>
 </tr>

         <tr>
            <td bgcolor="#E5E5E5" align="left" valign="top">&nbsp;</td>
								  <td bgcolor="#E5E5E5" align="left" valign="top">&nbsp;</td>
								  <td bgcolor="#E5E5E5" align="left" valign="top" colspan="5">
								    <font color="#000000" face="Verdana">
							        <span style="font-size: 8.5pt">
							         
						            </span></font></td>
									 <td bgcolor="#E5E5E5" align="left" valign="top">&nbsp;</td>
								  <td bgcolor="#E5E5E5" align="left" valign="top">&nbsp;</td>
									
 </tr>
</table>
<?php
$links = $paginator->getLinks ();
echo "<div class='paginator'> " . $links ;

echo "<p>Page " . $paginator->pageId . " of " . $paginator->totalPages . "</p>";
echo "</div>";
?>
